]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-global: Do not deal with allocated strings as const char
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 27 Feb 2018 13:20:47 +0000 (14:20 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 14 Mar 2018 13:30:47 +0000 (13:30 +0000)
The imagedir and userdatadir variables are not fetched from
constants/environment but created with g_strdup*/g_build*. Acknowledge that
and also free the strings in finalize.

src/shell-global.c

index 6eee3756b4c89c402394c371e502837679cf1fa0..c67ac4e4ac86d9e3b808e54ac9880511e7f87f89 100644 (file)
@@ -73,8 +73,8 @@ struct _ShellGlobal {
   ShellWM *wm;
   GSettings *settings;
   const char *datadir;
-  const char *imagedir;
-  const char *userdatadir;
+  char *imagedir;
+  char *userdatadir;
   GFile *userdatadir_path;
   GFile *runtime_state_path;
 
@@ -337,6 +337,10 @@ shell_global_finalize (GObject *object)
   g_clear_object (&global->userdatadir_path);
   g_clear_object (&global->runtime_state_path);
 
+  g_free (global->session_mode);
+  g_free (global->imagedir);
+  g_free (global->userdatadir);
+
   G_OBJECT_CLASS(shell_global_parent_class)->finalize (object);
 }